import { useSystemStore } from "@/store/system";

//新增       A
//编辑       U
//删除       D
//导入       I
//导出       E
//排序       S
//批量删除    B
const hasBut = {
  mounted(el, val) {
    const $systemStore = useSystemStore();
    let bottonList = $systemStore.button;
    const { value } = val;
    let isItem = null;
    if (bottonList.length) {
      isItem = bottonList.some((item) => {
        return item.indexOf(value) !== -1;
      });
    }
    if (!isItem) {
      el.parentNode && el.parentNode.removeChild(el);
    }
  }
};
const customPower = (app) => {
  app.directive("hasBut", hasBut);
};

export default customPower;
